load ResetTabs,BookPanes

! -------------- Start Template -----------------
GoSub ResetTabs,0
GoSub BookPanes,""

ClearTabs
#midPt=#rightMargin$/2-#leftSkip-10
SetTab 120,#midPt+120

! individuals for the book
cell GroupBox,"Target Individuals"
  width -1
  NewLine -3
  
  if _INDI is here
    #hasINDI="Yes"
  else
    #hasINDI="No"
  endif
  ShowAll _INDI
  Show _INDI
  DropTypes INDI

  ! Remove _INDI
  if #hasINDI="YES"
    cell LinkButton
    set image "minus" border none height 22 width 24
    Help "Click to remove a target individual"
    set MenuLink "Detach Event/Attribute/Link"
  endif
endGroup

! --------- Run the Script -----------
cell GroupBox,"Create Book"
  width -1
  newline -3
  cell LinkButton,"Create Book"
  set border shadowlesssquare fontColor "Control Text"
  sizetofit
  if #appName$!="GEDitCOM"
    if @_USER="Y"
      set ScriptLink "Reports/CreateBook" ScriptType "user"
    else
      set ScriptLink "Reports/CreateBook" ScriptType "system"
    endif
  else
    set ScriptLink "Reports/CreateBook" ScriptType "system"
  endif
  help "Click to typeset the book"
  
  if @_FLDR!=""
    hskip 10
    cell LinkButton
    set image "reveal" border none offset -1
    set width 18
    set ScriptLink "Open_FLDR.gcscpt" ScriptType "format" ScriptMessage @this.view
    set help "Open previously typeset book (if available)"
  endif
  
  Show _TSET
EndGroup

! --------- Author Settings -----------
cell GroupBox,"Author Information"
  width -1
  NewLine -3
  Show _AUTH
  Show _EMAIL
endGroup

! --------- Generation Settings -----------
cell GroupBox,"Generations"
  width -1
  NewLine -3
  Show _ANC
  Show _DES
EndGroup

! --------- Style Settings -----------
cell GroupBox,"Style Settings"
  width -1
  NewLine -3
  Show _TEXSTY
  Show _FFAM
  NewLine 1
  Show _PAPER
  Show _FONT
  NewLine 1
  Show _SIZE
  Show _NTOP
  NewLine 1
  Show _PTOP
  Show _TGEN
  NewLine 1
  Show _LINE
EndGroup

optionaltag _INDI,"Book Target Individual"

hideexcess
